<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>属性监听器</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			
		</div>
		<script type="text/javascript">
			var app = new Vue(
				{
					el:'#app',
					data:{
						fullname:'宋晓'
					},
					watch: { //听data数据变化 
						fullname(newValue, oldValue) {
							alert("OldNmae:"+ oldValue +"NewName:"+newValue);
						}
					}
					/* app.$watch('fullname',function(newValue,oldValue){
							alert("OldNmae:"+ oldValue +"NewName:"+newValue);
							});
					} */
				}
			);
			app.fullname="宋小宝";
		</script>
	</body>
</html>
